﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Dapper;
using FRMS.Helper;
using FRMS.Model;
namespace FRMS.DAL
{
    public class DeviceStateRecord
    {
        /// <summary>
        /// 新增设备上下线记录
        /// </summary>
        /// <param name="deviceInfo"></param>
        /// <returns></returns>
        public bool AddDeviceStateRecord(int eid, string state)
        {
            string UpdateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            string strSql = string.Format(@"INSERT INTO device_record(DeviceID,State,UpdateTime)
                                             VALUES({0},'{1}','{2}')", eid, state, UpdateTime);
            return SqlHelper<DataClear>.SqlExecute(strSql);
        }
    }
}
